//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class Connection : IOfficeXmlSerializableAs
    {
        private int id;

        private int idx;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public int Index
        {
            get { return idx; }
            set { idx = value; }
        }

        #region IOfficeXmlSerializableAs Members

        void IOfficeXmlSerializableAs.ReadXmlAs(string name, ReadContext context)
        {
            using (var c = context.Read(name))
            {
                Id = c.GetInteger("id");
                idx = c.GetInteger("idx");
            }
        }

        void IOfficeXmlSerializableAs.WriteXmlAs(string name, WriteContext context)
        {
            using (WriteContext c = context.Write(name))
            {
                c.SetInteger("id", Id);
                c.SetInteger("idx", idx);
            }
        }

        #endregion
    }
}